
## library
############################################################
. ./win-library.sh
. ./win-config.sh



## xtools
cloneZip     xlxpublic/xtools-win-mysql-5.7          $INSTALL_HOME    mysql



## config
mysqlPort=3306
mysqlBaseFolder=$INSTALL_HOME/mysql
mysqlDataFolder=$INSTALL_HOME/mysql/data
mkdir $mysqlDataFolder
cp $mysqlBaseFolder/my-default.ini $mysqlBaseFolder/my.ini
echo -e "basedir=$mysqlBaseFolder\r\n" >>$mysqlBaseFolder/my.ini
echo -e "datadir=$mysqlDataFolder\r\n" >>$mysqlBaseFolder/my.ini
echo -e "port=$mysqlPort\r\n"          >>$mysqlBaseFolder/my.ini

echo -e "$mysqlBaseFolder/bin/mysqld --initialize --console\r\n"  >$mysqlBaseFolder/mysql-initialize.bat
echo -e "echo please remember your password!\r\n"  >>$mysqlBaseFolder/mysql-initialize.bat
echo -e "pause\r\n"  >>$mysqlBaseFolder/mysql-initialize.bat

echo -e "$mysqlBaseFolder/bin/mysqld --console\r\n"  >$mysqlBaseFolder/mysql-server.bat
echo -e "pause\r\n"  >>$mysqlBaseFolder/mysql-server.bat

echo -e "$mysqlBaseFolder/bin/mysql -P${mysqlPort} -uroot -p\r\n"  >$mysqlBaseFolder/mysql-client.bat
echo -e "pause\r\n"  >>$mysqlBaseFolder/mysql-client.bat


#Old Password=FX2*3ab7nS3K
#New Password = ALTER USER 'root'@'localhost' IDENTIFIED BY 'new pwd';
#New Password = set password for root@'localhost' = password('1234'); 


